# @noautodeps
load("@fbcode//buck2/tests:buck_e2e.bzl", "buck2_e2e_test")
load("@fbcode_macros//build_defs:python_library.bzl", "python_library")
load("@prelude//cfg/modifier:name.bzl", "NAMED_CONSTRAINT_SETTINGS")
load(":constraint_setting_group.bzl", "constraint_setting_group")

oncall("buck2")

buck2_e2e_test(
    name = "test_cli_modifiers.py",
    srcs = ["test_cli_modifiers.py"],
    deps = [":modifiers_util"],
)

buck2_e2e_test(
    name = "test_invoke_cfg_constructors.py",
    srcs = ["test_invoke_cfg_constructors.py"],
    data_dir = "test_invoke_cfg_constructors_data",
)

buck2_e2e_test(
    name = "test_set_cfg_modifiers.py",
    srcs = ["test_set_cfg_modifiers.py"],
    test_with_deployed_buck2 = True,
)

buck2_e2e_test(
    name = "test_invoke_cfg_constructors_bad_constraints.py",
    srcs = ["test_invoke_cfg_constructors_bad_constraints.py"],
    data_dir = "test_invoke_cfg_constructors_bad_constraints_data",
)

buck2_e2e_test(
    name = "test_cfg_modifiers.py",
    srcs = ["test_cfg_modifiers.py"],
    test_with_deployed_buck2 = True,
)

buck2_e2e_test(
    name = "test_cfg_constructors_inplace.py",
    srcs = ["test_cfg_constructors_inplace.py"],
    test_with_deployed_buck2 = True,
    test_with_reverted_buck2 = True,
)

constraint_setting_group(
    name = "test_named_constraint_settings",
    deps = NAMED_CONSTRAINT_SETTINGS.keys(),
)

buck2_e2e_test(
    name = "test_cfg_modifiers_attr",
    srcs = ["test_cfg_modifiers_attr.py"],
    data_dir = "test_cfg_modifiers_attr_data",
    deps = [":modifiers_util"],
)

python_library(
    name = "modifiers_util",
    srcs = ["modifiers_util.py"],
    deps = ["//buck2/tests/e2e_util/api:api"],
)
